package com.bestcem.xm.user.grpc.service.param;


import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * 开放平台的层级更新参数
 *
 * @author wangyunyun <yunyun.wang@idiaoyan.com>
 * @version v1.0
 * @date 2022/2/21 10:47
 */
@Getter
@Setter
public class GroupLevelSyncParam {

    /**
     * 层级名称
     */
    @NotBlank(message = "4;group_level_list.name cannot be blank")
    @Length(max = 30, message = "7;group_level_list[name = {0}] length cannot be exceed 30")
//    @Pattern(regexp = RegTypes.GROUP_LEVEL_NAME, dto = "5;group_level_list[name = {0}] 含有非法字符")
    @ExcelProperty(value = "name", index = 0)
    private String name;

    /**
     * 当前层级数
     */
    @NotNull(message = "4;group_level_list.level cannot be null")
    @Range(min = 0, max = 99, message = "7;group_level_list[level = {0}] should be between 0 and 99")
    @ExcelProperty(value = "level", index = 1)
    private Integer level;

}
